#include<iostream>
#include<string>
#include<set>
using namespace std;
const int N = 110;
int n, d;
string s[N];
int main()
{
	cin >> n >> d;
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	int ans = 0;
	int sum = 0;
	for (int i = 0; i < d; i++) {
		bool flag = 0;
		for (int j = 0; j < n; j++) {
			if (s[j][i] == 'x') {
				flag = 1;
				break;
			}
		}
		if (!flag) {
			sum++;
		}
		else {
			sum = 0;
		}
		ans = max(ans, sum);
	}
	cout << ans << endl;
	return 0;
}